<?php
/**
 *
 * @author Alton Crossley <crossleyframework@nogahidebootstrap.com>
 * @package Crossley Framework
 *
 * @copyright Copyright (c) 2003-2009, Nogaide BootStrap INC. All rights reserved.
 * @license BSD http://opensource.org/licenses/bsd-license.php
 * @version $Id:$
 *
 */

/**
 * @namespace
 */
namespace X\Controller\Response\Renderer;
use \X\Controller\Response\Renderer;
use \X\Controller\Response;

/**
 *
 * Default Response Renderer
 */
class RenderDefault Implements Renderer
{
    /**
	 * render response
	 *
	 * @param Response $Response
	 * @return string
	 */
	public function render(Response $Response)
	{
	    // @todo make a json in HTML output and a master page
	    switch ($Response->OutputMethod()){
            case Response\Standard::ENCODE_COMPLEX:
                return json_encode($Response->getArray());
                break;
            case Response\Standard::ENCODE_JSON:
                return json_encode($Response->getArray());
                break;
            default:
                return $Response->Html();
                break;
        }
	}
}